<#assign className = table.className>
<#assign classNameLower = table.classNameLower>

<#if  '${subpackage}'=="">
package ${intfPackage}.entity;
<#else>
package ${basepackage}.${subpackage}.entity;
</#if>

import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;

@ApiModel("${table.tableRemark}")
@Table(name = "${table.sqlName}")
@Data
public class ${className} implements Serializable{
	<@generateFields/>
}

<#macro generateFields>

	<#list table.columns as column>
		<#if !column.pk && !column.fk >
	<#if column.baseField>@JsonIgnore</#if>
    ${column.apiModelProperty}
    @Column(name = "${column.sqlName}")
    private ${column.javaType} ${column.columnNameLower};
    <#elseif column.pk>
    @Id
	@OrderBy("desc")
    @Column(name = "${column.sqlName}")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public ${column.javaType} ${column.columnNameLower};
		</#if>
	</#list>
</#macro>
